﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using simpleHotel.Business;
using simpleHotel.Data;

namespace simpleHotel.Business
{
   public class ObjPromotions
    {
       public IList<Promotion> getPromotion()
       {
           List<Promotion> data = new List<Promotion>();
           var p = from c in Singleton.DataContext.Promotions
                   select c;
           if (p != null)
           {
               foreach (Promotion item in p)
               {
                   data.Add(item);
               }
           }
           return data;
       }

       public List<Promotion> getPromotionByID(int id)
       {
           var data = (from promotion in Singleton.DataContext.Promotions
                            where promotion.ID == id
                            select promotion).ToList();           
           return data;
       }
    }
}
